package client.view;

import java.awt.GridLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;

import net.GameInfo;

/**
 * A visualization of a "table" for the TableList in the MasterServerView.
 * Tables are represented by instances of GameInfo.  The TableView displays
 * information about what game is being played at that table and the server-side
 * options in place.
 */
public class TableView extends JPanel
{
	private GameInfo gi;
	/**
	 * Create a new view for the given GameInfo model
	 */
	public TableView(GameInfo g) {
		gi = g;
		createInterface();
		this.setLayout(new GridLayout(0,1));
	}
	/**
	 * Create the interface for the AccountProxyView
	 */
	private void createInterface() {
		this.add(new JLabel(gi.displayInfo()));
	}
	/**
	 * Return the GameInfo object associated with this TableView
	 */
	public GameInfo getGameInfo()
	{
		return gi;
	}
}
